<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    538. Convert BST to Greater Tree
   </h1>
   <p>
    Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.
   </p>
   <p>
    <b>
     Example:
    </b>
   </p>
   <pre>
<b>Input:</b> The root of a Binary Search Tree like this:
              5
            /   \
           2     13

<b>Output:</b> The root of a Greater Tree like this:
             18
            /   \
          20     13
</pre>
  </div>
  <div>
   <h1 class="question_title">
    538. 把二叉搜索树转换为累加树
   </h1>
   <p>
    给定一个二叉搜索树（Binary Search Tree），把它转换成为累加树（Greater Tree)，使得每个节点的值是原来的节点值加上所有大于它的节点值之和。
   </p>
   <p>
    <strong>
     例如：
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 二叉搜索树:
              5
            /   \
           2     13

<strong>输出:</strong> 转换为累加树:
             18
            /   \
          20     13
</pre>
  </div>
 </body>
</html>